/* 
const dialog = {
  confirm: (options) => {
    wx.showModal({
      title: '提示',
      content: options.mes,
      success(res) {
        if (res.confirm) {
          options.opts()
        } else if (res.cancel) {
        }
      }
    })
  },
  alert: Dialog.alert,
  loading: {
    open: () => {
      wx.showLoading({ title: '加载中' })
    },
    close: () => {
      wx.hideLoading()
    }
  }
}; */
function toast(options){
	uni.showToast({
		title: options.mes,
		icon: "none",
		duration: 2000,
		complete: () => {
			options.callback ? options.callback() : null
		}
	});
};
function error(mes){
	uni.showToast({
		title: mes,
		icon: "error",
		duration: 2000
	});
}
function success(mes){
	uni.showToast({
		title: mes,
		icon: "success",
		duration: 2000
	});
}
/* dialog.validateError = (...args) => {
  validatorDefaultCatch(...args);
};

export function validatorDefaultCatch(err, type = "message") {
  wx.showToast({
    title: err.errors[0].message,
    icon: 'none',
    duration: 2000
  })
  return false
}*/
export default {
	toast,
	error,
	success
};